package com.guiji.quartz.mapper;

import com.guiji.common.core.mybatisplus.core.BaseMapperPlus;
import com.guiji.quartz.domain.SpiderNews;
import com.guiji.quartz.domain.SysJob;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 调度任务信息 数据层
 *
 * @author ruoyi
 */
public interface SysJobMapper extends BaseMapperPlus<SysJob> {
	@Insert({
		"<script>",
		"insert into spider_news_history(id,news_id,news_title,news_content,content_size,news_pic_json,news_url,news_source,news_category,news_authors,news_public_time," +
			"create_by,create_time,update_by,update_time,backup_1,backup_2) values ",
		"<foreach collection='lists' item='item' separator=','>",
		"(#{item.id},#{item.newsId}, #{item.newsTitle}, #{item.newsContent}, #{item.contentSize}, #{item.newsPicJson}, #{item.newsUrl}, #{item.newsSource}, #{item.newsCategory}" +
			", #{item.newsAuthors}, #{item.newsPublicTime}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime}, #{item.backup1}, #{item.backup2})",
		"</foreach>",
		"</script>"
	})
	int bulkInsert(@Param(value="lists") List<SpiderNews> lists);
}
